import Vue from 'vue'
import Router, { RouteConfig } from 'vue-router'
import Login from '../views/Login.vue'
import main from '../views/main.vue'
import ExamSystem from '../views/ExamSystem.vue'
import ExamQuestion from '../views/ExamQuestion.vue'
import StudentHomePage from '../views/StudentHomePage.vue'
Vue.use(Router)

const routes: Array<RouteConfig> = [
  {
    path: '/Login',
    name: '登录',
    component: Login
  },
  {
    path: '/index',
    name: 'main',
    redirect: '/index/student-homepage',
    component: main,
    children: [
      {
        path: 'exam',
        name: '考试系统',
        component: ExamSystem
      },
      {
        // 面包屑中耳机菜单的前一项
        meta:{
          origin:"考试管理"
        },
        path: 'examquestion',
        name: '习题库',
        component: ExamQuestion
      },
      {
        path: 'student-homepage',
        name: "学生主页",
        component: StudentHomePage
      },
      {
        path: 'course',
        name: '我的课程',
        redirect: 'student-homepage'
      },
      {
        path: 'aidevelopment',
        name: 'AI开发中心',
        redirect: 'student-homepage'
      },
    ]
  },
]

const router = new Router({
  mode: 'history',
  base: process.env.BASE_URL,
  routes
})

export default router
